

//
//  XYBusinessDetailFrame.m
//  Zhihuijinfu
//
//  Created by XY Lv on 17/3/21.
//  Copyright © 2017年 王笛. All rights reserved.
//

#import "XYBusinessDetailFrame.h"
#import "XYCommon.h"
@implementation XYBusinessDetailFrame

- (void)setXyDetailItem:(XYBusinessDetailItem *)xyDetailItem{
    _xyDetailItem = xyDetailItem;
    [self xySetSubviewsFrame];
}

- (void)xySetSubviewsFrame{
    self.xyIconImgViewF = CGRectMake(xy(24), xy(5), xy(10), xy(10));
    
    self.xyTitleBtnF = CGRectMake(xyPadding + CGRectGetMaxX(self.xyIconImgViewF), 0, xy(50), xy(20));
    self.xyTimeLableF = CGRectMake(CGRectGetMaxX(self.xyTitleBtnF) + xyPadding, 0, WDScreenW - CGRectGetMaxX(self.xyTitleBtnF) - xyPadding * 2, CGRectGetHeight(self.xyTitleBtnF));
    CGFloat localH ;
    if([self.xyDetailItem.type isEqualToString:@"2"]){
        localH = xy(15);
    }else{
        localH = 0;

    }
    self.xyLocalAlertViewF = CGRectMake(self.xyTitleBtnF.origin.x,CGRectGetMaxY(self.xyTitleBtnF) + xyPadding/2, xy(180),localH);
    
    CGSize cotentSize =[XYCommon xy_getSizeWithStr:self.xyDetailItem.content font:[UIFont systemFontOfSize:xy(12)] maxSize:CGSizeMake(WDScreenW - self.xyTitleBtnF.origin.x - xyPadding, MAXFLOAT)];
    self.xyContentLabelF = CGRectMake(self.xyTitleBtnF.origin.x, CGRectGetMaxY(self.xyLocalAlertViewF) + xyPadding, cotentSize.width,cotentSize.height);
    
    if(self.xyDetailItem.file_data.count >0&&[self.xyDetailItem.type isEqualToString:@"2"]){
        self.xyPhotoImgViewF = CGRectMake(self.xyTitleBtnF.origin.x, CGRectGetMaxY(self.xyContentLabelF) + xyPadding, xy(67.5)*1.5, xy(50)*1.5);
        self.xyPhotoPlaceholderF = CGRectMake(self.xyPhotoImgViewF.origin.x, self.xyPhotoImgViewF.origin.y, self.xyPhotoImgViewF.size.width+xyPadding, self.xyPhotoImgViewF.size.height + xyPadding);

    }else{
        self.xyPhotoImgViewF = CGRectMake(self.xyTitleBtnF.origin.x, CGRectGetMaxY(self.xyContentLabelF) + xyPadding, xy(67.5)*1.5, 0);
        self.xyPhotoPlaceholderF = CGRectMake(self.xyPhotoImgViewF.origin.x, self.xyPhotoImgViewF.origin.y, self.xyPhotoImgViewF.size.width+xyPadding, 0);

    }
    
    
    
    self.xyMessageBtnF = CGRectMake(WDScreenW - xyPadding - xy(35), CGRectGetMaxY(self.xyPhotoImgViewF), xy(35), xy(20));
    self.xyCellH = CGRectGetMaxY(self.xyMessageBtnF) + xyPadding *2;
    self.xyIconImgViewLineF = CGRectMake(self.xyIconImgViewF.origin.x+(self.xyIconImgViewF.size.width - xy(5))/2
                                         , CGRectGetMaxY(self.xyIconImgViewF)-CGRectGetHeight(self.xyIconImgViewF)/2, xy(5), self.xyCellH );
    
}

@end


























